package cn.lisens.modules.sys.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.lisens.modules.sys.model.User;


@Controller
@RequestMapping("/user")
public class TestController {
	protected Logger logger = LoggerFactory.getLogger(this.getClass());; 
	
	@RequestMapping("/index")
	public String hello(Model model) {
		logger.info("访问user接口");
		System.err.println("日志：访问user/index接口");
		User user = new User();
		user.setIdcard("123");
		user.setFullname("李四");
		model.addAttribute("user", user);
		return "user";
	}
	@RequestMapping("/userJson")
	@ResponseBody
	public User user(Model model) {
		User user = new User();
		user.setIdcard("123");
		user.setFullname("李四");
		return user;
	}
	@RequestMapping("/string")
	@ResponseBody
	public String str(Model model) {
		
		return "this is user info";
	}
}
